cmake_minimum_required(VERSION 3.5)

# ==== 项目定义 ====
set(PROJECT_NAME "dual_capture")   # 这里改项目名即可全局生效
project(${PROJECT_NAME} LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# ==== OpenCV 路径设置 ====
# 如果你的 OpenCV 没装到系统目录，可手动指定 cmake 模块路径
set(OpenCV_DIR "${CMAKE_CURRENT_SOURCE_DIR}/3rd/opencv-4.12.0-install/lib/cmake/opencv4")

# ==== 查找 OpenCV ====
find_package(OpenCV REQUIRED)

# ==== 源码路径 ====
set(SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src")

# ==== 生成可执行文件 ====
add_executable(${PROJECT_NAME} ${SRC_DIR}/main.cpp)

# ==== 链接 OpenCV 库 ====
target_link_libraries(${PROJECT_NAME} PRIVATE ${OpenCV_LIBS})

# ==== 可选: 打印构建信息 ====
message(STATUS "Project Name: ${PROJECT_NAME}")
message(STATUS "OpenCV version: ${OpenCV_VERSION}")
message(STATUS "OpenCV include dirs: ${OpenCV_INCLUDE_DIRS}")
